<template>
  <div class="search">
    <f-form ref="form" :action="api.reportForMaster" :form-key="this.formItem.undefined" >
      <f-form-item label=""  name="ver" dataType="number"   :value="formItem.ver" />
      <f-form-item label=""  name="type"    :value="formItem.type" />
      <f-form-item label=""  name="instructNumber"    :value="formItem.instructNumber" />
      <f-form-item label=""  name="planType" dataType="number"   :value="formItem.planType" />
      <f-form-item label=""  name="projectCode"    :value="formItem.projectCode" />
      <f-form-item label=""  name="projectName"    :value="formItem.projectName" />
      <f-form-item label=""  name="majorName"    :value="formItem.majorName" />
      <f-form-item label=""  name="majorCode"    :value="formItem.majorCode" />
      <f-form-item label=""  name="packageName"    :value="formItem.packageName" />
      <f-form-item label=""  name="packageNo"    :value="formItem.packageNo" />
      <f-form-item label=""  name="materialWbsCode"    :value="formItem.materialWbsCode" />
      <f-form-item label=""  name="materialCode"    :value="formItem.materialCode" />
      <f-form-item label=""  name="materialName"    :value="formItem.materialName" />
      <!-- <f-form-item label=""  name="materiaSpecs"    :value="formItem.materiaSpecs" /> -->
      <f-form-item label=""  name="materiaSpecs"    :value="formItem.materiaSpecs" />
      <f-form-item label=""  name="materialDesc"    :value="formItem.materialDesc" />
      <f-form-item label=""  name="technicalData"    :value="formItem.technicalData" />
      <f-form-item label=""  name="serviceWbsCode"    :value="formItem.serviceWbsCode" />
      <f-form-item label=""  name="serviceCode"    :value="formItem.serviceCode" />
      <f-form-item label=""  name="subjectName"    :value="formItem.subjectName" />
      <f-form-item label=""  name="packageDesc"    :value="formItem.packageDesc" />
      <f-form-item label=""  name="levelNo"    :value="formItem.levelNo" />
      <f-form-item label=""  name="contractDesc"    :value="formItem.contractDesc" />
      <f-form-item label=""  name="materialArea"    :value="formItem.materialArea" />
      <f-form-item label=""  name="materialUse"    :value="formItem.materialUse" />
      <f-form-item label=""  name="contractBillQuantity"    :value="formItem.contractBillQuantity" />
      <f-form-item label=""  name="beforeMarkQuantity"    :value="formItem.beforeMarkQuantity" />
      <f-form-item label=""  name="costQuantity100"    :value="formItem.costQuantity100" />
      <f-form-item label=""  name="costQuantity200"    :value="formItem.costQuantity200" />
      <f-form-item label=""  name="loss"    :value="formItem.loss" />
      <f-form-item label=""  name="measurementUnit"    :value="formItem.measurementUnit" />
      <f-form-item label=""  name="unitBillQuantity100"    :value="formItem.unitBillQuantity100" />
      <f-form-item label=""  name="unitBillQuantity200"    :value="formItem.unitBillQuantity200" />
      <f-form-item label=""  name="currentFinishMonthCount"    :value="formItem.currentFinishMonthCount" />
      <f-form-item label=""  name="lastFinishMonthCount"    :value="formItem.lastFinishMonthCount" />
      <f-form-item label=""  name="totalFinishCount"    :value="formItem.totalFinishCount" />
      <f-form-item label=""  name="mainPrice"    :value="formItem.mainPrice" />
      <f-form-item label=""  name="installPrice"    :value="formItem.installPrice" />
      <f-form-item label=""  name="syntheticalPrice"    :value="formItem.syntheticalPrice" />
      <f-form-item label=""  name="mainAmount"    :value="formItem.mainAmount" />
      <f-form-item label=""  name="installAmount"    :value="formItem.installAmount" />
      <f-form-item label=""  name="syntheticalAmount"    :value="formItem.syntheticalAmount" />
      <f-form-item label=""  name="mainPrice1"    :value="formItem.mainPrice1" />
      <f-form-item label=""  name="installPrice1"    :value="formItem.installPrice1" />
      <f-form-item label=""  name="syntheticalPrice1"    :value="formItem.syntheticalPrice1" />
      <f-form-item label=""  name="mainPrice2"    :value="formItem.mainPrice2" />
      <f-form-item label=""  name="installPrice2"    :value="formItem.installPrice2" />
      <f-form-item label=""  name="syntheticalPrice2"    :value="formItem.syntheticalPrice2" />
      <f-form-item label=""  name="mainPrice3"    :value="formItem.mainPrice3" />
      <f-form-item label=""  name="installPrice3"    :value="formItem.installPrice3" />
      <f-form-item label=""  name="syntheticalPrice3"    :value="formItem.syntheticalPrice3" />
      <f-form-item label=""  name="mainsumPrice1"    :value="formItem.mainsumPrice1" />
      <f-form-item label=""  name="installsumPrice1"    :value="formItem.installsumPrice1" />
      <f-form-item label=""  name="contractsumSyntheticalPrice1"    :value="formItem.contractsumSyntheticalPrice1" />
      <f-form-item label=""  name="mainsumPrice2"    :value="formItem.mainsumPrice2" />
      <f-form-item label=""  name="installsumPrice2"    :value="formItem.installsumPrice2" />
      <f-form-item label=""  name="contractsumSyntheticalPrice2"    :value="formItem.contractsumSyntheticalPrice2" />
      <f-form-item label=""  name="mainsumPrice3"    :value="formItem.mainsumPrice3" />
      <f-form-item label=""  name="installsumPrice3"    :value="formItem.installsumPrice3" />
      <f-form-item label=""  name="contractsumSyntheticalPrice3"    :value="formItem.contractsumSyntheticalPrice3" />
      <f-form-item label=""  name="currentMonthmainPrice"    :value="formItem.currentMonthmainPrice" />
      <f-form-item label=""  name="currentMonthinstallPrice"    :value="formItem.currentMonthinstallPrice" />
      <f-form-item label=""  name="currentMonthsumPrice"    :value="formItem.currentMonthsumPrice" />
      <f-form-item label=""  name="lastMonthmainPrice"    :value="formItem.lastMonthmainPrice" />
      <f-form-item label=""  name="lastMonthinstallPrice"    :value="formItem.lastMonthinstallPrice" />
      <f-form-item label=""  name="lastMonthsumPrice"    :value="formItem.lastMonthsumPrice" />
      <f-form-item label=""  name="totalMonthmainPrice"    :value="formItem.totalMonthmainPrice" />
      <f-form-item label=""  name="totalMonthinstallPrice"    :value="formItem.totalMonthinstallPrice" />
      <f-form-item label=""  name="totalsumPrice"    :value="formItem.totalsumPrice" />
      <f-form-item label=""  name="brandName"    :value="formItem.brandName" />
      <f-form-item label=""  name="remark"    :value="formItem.remark" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'reportForMasterForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          undefined: '',
          ver: '',
          type: '',
          instructNumber: '',
          planType: '',
          projectCode: '',
          projectName: '',
          majorName: '',
          majorCode: '',
          packageName: '',
          packageNo: '',
          materialWbsCode: '',
          materialCode: '',
          materialName: '',
          // materiaSpecs: '',
          materiaSpecs: '',
          materialDesc: '',
          technicalData: '',
          serviceWbsCode: '',
          serviceCode: '',
          subjectName: '',
          packageDesc: '',
          levelNo: '',
          contractDesc: '',
          materialArea: '',
          materialUse: '',
          contractBillQuantity: '',
          beforeMarkQuantity: '',
          costQuantity100: '',
          costQuantity200: '',
          loss: '',
          measurementUnit: '',
          unitBillQuantity100: '',
          unitBillQuantity200: '',
          currentFinishMonthCount: '',
          lastFinishMonthCount: '',
          totalFinishCount: '',
          mainPrice: '',
          installPrice: '',
          syntheticalPrice: '',
          mainAmount: '',
          installAmount: '',
          syntheticalAmount: '',
          mainPrice1: '',
          installPrice1: '',
          syntheticalPrice1: '',
          mainPrice2: '',
          installPrice2: '',
          syntheticalPrice2: '',
          mainPrice3: '',
          installPrice3: '',
          syntheticalPrice3: '',
          mainsumPrice1: '',
          installsumPrice1: '',
          contractsumSyntheticalPrice1: '',
          mainsumPrice2: '',
          installsumPrice2: '',
          contractsumSyntheticalPrice2: '',
          mainsumPrice3: '',
          installsumPrice3: '',
          contractsumSyntheticalPrice3: '',
          currentMonthmainPrice: '',
          currentMonthinstallPrice: '',
          currentMonthsumPrice: '',
          lastMonthmainPrice: '',
          lastMonthinstallPrice: '',
          lastMonthsumPrice: '',
          totalMonthmainPrice: '',
          totalMonthinstallPrice: '',
          totalsumPrice: '',
          brandName: '',
          remark: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.undefined) {
          let params={
              undefined:data.undefined
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
